#ifndef PUBLISHBLOG_H
#define PUBLISHBLOG_H

#include <QObject>
#include <QWidget>
#include <QMouseEvent>
#include <QString>
#include <QVBoxLayout>
#include <QHBoxLayout>
#include <QSpacerItem>
#include <QLabel>
#include <QTextBrowser>
#include <QDebug>
#include <QTextEdit>
#include <QLineEdit>
#include <QPushButton>
#include <QFileDialog>
#include <QDateTime>
#include <QComboBox>

class PublishBlog : public QWidget
{
    Q_OBJECT
public:
    explicit PublishBlog(QWidget *parent = nullptr);
    bool eventFilter(QObject *obj, QEvent *event);
private:
    QLineEdit *lineTitle;
    QTextEdit *textContent;
    QLabel *labelPix;
    QPushButton *btnPublish;
    QComboBox *comboBoxPay;
    QComboBox *comboboxType;

    QDateTime currentTime;
    int isPay= 0;
    QPixmap insertPix;
    int pixWidth, pixHeight, maxWidth, maxHeight;
    QString blogContent;
    QString blogTitle;
    QString blogType;
    QString pixName;
    int pixIdx=0;
    QList<QString> nameList;
signals:
    void signalPublishBlog(QMap<QString, QString> mapInfo, QList<QString> list);
public slots:
    void slotBtnPublish();
    void slotInsertPix();
    void setPay(int pay);
    void setType(int type);
};

#endif // PUBLISHBLOG_H
